home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Nordlicht Spiele / Nordlicht Spiele 04-08 (19xx)(Nordlicht)(DE)(PD).zip / Nordlicht Spiele 04-08 (19xx)(Nordlicht)(DE)(PD).adf / Fold.Acc / Fold.amosSourceCode
AMOS Source Code  |  1992-12-24  |  2KB  |  70 lines

  1. '----------------------------------------------------------------------------
  2. '
  3. ' AMOS Procedure Locker, by Francois Lionet. AMOS 1.2 and over ONLY! 
  4. '
  5. '----------------------------------------------------------------------------
  6. '
  7. ' To operate:
  8. '
  9. ' First load this program as an accessory. 
  10. ' Load your program into the editor
  11. ' Call this program (the loaded accessory).
  12. ' It will lock all CLOSED procedures. They will be forever LOCKED! So be very
  13. ' careful. Have a backup of the original.  
  14. '
  15. ' AMOS 1.1 users: do NOT open a locked procedure! It will crash the computer!
  16. '  
  17. ' PS: Yes, of course, the procedure that locks the procedures is locked  
  18. ' by itself. Wicked izn't it?!?    
  19. '----------------------------------------------------------------------------
  20. '
  21. Default Palette 0,0,$FFF,0
  22. Screen Open 7,640,72,4,Hires : Curs Off 
  23. Screen Display 7,,100,,
  24. Centre At(,2)+Border$("   AMOS Procedures locker   ",1)
  25. Locate 0,5
  26. '
  27. If Areg(3)=0
  28.    Centre "Sorry! I only work with AMOS 1.2 and over!"
  29.    BYEBYE
  30. End If 
  31. '
  32. If Dreg(0)=0
  33.    Centre "You must call me as an accessory!"
  34.    BYEBYE
  35. End If 
  36. '
  37. LOCKIT
  38. BYEBYE
  39. '
  40. Procedure LOCKIT
  41.    AD=Areg(3)
  42.    TKPROC=$376
  43.    Do 
  44.       L=Peek(AD)*2
  45.       Exit If L=0
  46.       If Deek(AD+2)=TKPROC
  47.          P=Deek(AD+10)
  48.          If Btst(15,P)
  49.             Bset 14,P
  50.             P=(P and $FF00)+Rnd(254)+1
  51.             Doke AD+10,P
  52.             Inc TT
  53.          End If 
  54.       End If 
  55.       AD=AD+L
  56.    Loop 
  57.    If TT
  58.       A$="I have locked"+Str$(TT)+" procedure"
  59.       If TT>1 : A$=A$+"s" : End If 
  60.       A$=A$+"."
  61.    Else 
  62.       A$="No procedures to lock!"
  63.    End If 
  64.    Centre A$
  65. End Proc
  66. Procedure BYEBYE
  67.    Print : Print 
  68.    Centre "Press any key"
  69.    Wait Key : Screen Close 7 : Edit 
  70. End Proc